<?php 
/*
Template Name: Link
*/
get_header(); ?>

<hr />

<div id="wrapper">
<div id="content">

<h2>Links</h2>
<?php 
//Faccio la query per ritornare il custom post type "link" //TODO: traddurre in inglese!
			$type = 'link';
			$args=array(
				'post_type' => $type,
				'post_status' => 'publish',
				'paged' => $paged,
				'posts_per_page' => 10,
				'caller_get_posts'=> 1
			);
			$wp_query = null;
			$wp_query = new WP_Query($args);
			
		?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post_custom" id="post-<?php the_ID(); ?>">

	 <h3 class="storytitle"><?php the_title(); ?></h3>
<!--	<div class="meta"><span class="user"><?php the_author() ?> @ <?php the_time() ?></span> <?php edit_post_link(__('Edit This')); ?></div>
-->
	<div class="storycontent">
		<?php the_content(__('(more...)')); ?> </br>
		<div class="post-details">
			<strong> Link: </strong> <a href="<?php echo get_post_meta(get_the_ID(),'Link', true); ?>" target="_blank"><?php the_title(); ?></a>
		</div>
	</div>

</div>

<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>

<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>

<?php get_footer(); ?>